import java.util.List;

public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode treeNode = binaryTree.createTree();
        System.out.println(binaryTree.getKLevelNodeCount(treeNode, 3));
        binaryTree.levelOrder(treeNode);
        System.out.println();
        System.out.println(binaryTree.isCompleteTree(treeNode));
        System.out.println();
        System.out.println(binaryTree.find(treeNode, 'A').val);
        System.out.println();
        System.out.println(binaryTree.getHeight(treeNode));
        System.out.println();
        binaryTree.getLeafNodeCount1(treeNode);
        System.out.println(binaryTree.leafSize);
        System.out.println(binaryTree.getLeafNodeCount2(treeNode));
        binaryTree.size(treeNode);
        System.out.println(binaryTree.nodeSize);
        System.out.println(binaryTree.size2(treeNode));
        binaryTree.preOrder(treeNode);
        System.out.println();
        binaryTree.inOrder(treeNode);
        System.out.println();
        binaryTree.postOrder(treeNode);
        binaryTree.lowestCommonAncestor(treeNode, treeNode.left.right, treeNode.left.right.right);
        for (List<Character> list:binaryTree.levelOrderBottom(treeNode)) {
            System.out.println(list.toArray());
        }
        binaryTree.postorderTraversal(treeNode);
        Solution solution = new Solution();
        int[] preorder = {3,9,20,15,7};
        int[] inorder = {9,3,15,20,7};
        solution.buildTree(preorder,inorder);
    }
}
